﻿@{
    ViewBag.Title = "个人注册";
    Layout = "~/Views/Shared/_Register.cshtml";
}
<script src="~/Scripts/jquery-1.8.2.min.js"></script>
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
<form id="regForm" action="#" method="post">
    <div class="zhuc_biaod">
        <div class="reg-items">
            <span class="reg-label">
                <label for="J_Name">用户名：</label>
            </span>
            <input name="loginName" class="i-text" type="text">  <!--用户名文本框-->
            <!--备注————display使用 inline-block-->
            <div class="msg-box">
                <div class="msg-box" style="display: none;">
                    <div class="msg-weak" style="display: inline-block;">
                        <i></i>
                        <div class="msg-cont">4-20个字符，支持汉字、字母、数字及“-”、“_”组合</div>
                    </div>
                </div>
                <div class="msg-weak err-tips" style="display: inline-block;"><div>请输入用户名</div></div>
            </div>
            <span class="suc-icon"></span>
        </div>
        <div class="reg-items">
            <span class="reg-label">
                <label for="J_Name">设置密码：</label>
            </span>
            <input name="loginPwd" class="i-text" type="text"><!--设置密码文本框-->
            <!--备注————display使用 inline-block-->
            <div class="msg-box">
                <div class="msg-box" style="display: none;">
                    <div class="msg-weak" style="display: inline-block;">
                        <i></i>
                        <div class="msg-cont">键盘大写锁定已打开，请注意大小写!</div>
                    </div>
                </div>
                <div class="msg-weak err-tips" style="display:none;"><div>请输入密码</div></div>
            </div>
        </div>
        <div class="reg-items">
            <span class="reg-label">
                <label for="J_Name">确认密码：</label>
            </span>
            <input name="password" class="i-text" type="text"><!--确认密码文本框-->
            <!--备注————display使用 inline-block-->
            <div class="msg-box">
                <div class="msg-weak err-tips" style="display: none;"><div>密码不一样</div></div>
            </div>
        </div>
        <div class="reg-items">
            <span class="reg-label">
                <label for="J_Name">手机号码：</label>
            </span>
            <input name="userPhone" class="i-text" type="text"><!--手机号码文本框-->
            <!--备注————display使用 inline-block-->
            <div class="msg-box">
                <div class="msg-weak err-tips" style="display:none;"><div>手机号不能为空</div></div>
            </div>
        </div>
        <div class="reg-items">
            <span class="reg-label">
            </span>
            <input class="i-text i-short" type="text"><!--验证码文本框-->
            <div class="check check-border" style="position:relative;left:0">
                <a class="check-phone" style="padding:11px 10px 14px 10px;*line-height:60px;">获取短信验证码</a>
                <span class="check-phone disable" style="display: none;"><em>60</em>秒后重新获取</span>
                <a class="check-phone" style="display: none;padding:11px 10px 14px 10px">重新获取验证码</a>
            </div>
            <!--备注————display使用 inline-block-->
            <div class="msg-box">
                <div class="msg-weak err-tips" style="display:none;"><div>请输入短信验证码</div></div>
            </div>
        </div>
        <div class="reg-items">
            <span class="reg-label">
                <label for="J_Name"> </label>
            </span>
            <div class="dag_biaod">
                <input type="checkbox" value="english">
                阅读并同意
                <a href="#" class="ftx-05 ml10">《wangdi通城用户注册协议》</a>
                <a href="#" class="ftx-05 ml10">《隐私协议》</a>
            </div>
        </div>
        <div class="reg-items">
            <span class="reg-label">
                <label for="J_Name"> </label>
            </span>
            <input class="reg-btn" value="立即注册" type="submit">
        </div>
    </div>
    <div class="xiaogg">
        <img src="~/Content/images/cdsgfd.jpg">
    </div>
</form>
<script src="~/Scripts/jquery-1.8.2.js"></script>
<script src="~/Scripts/layer/jquery-1.8.3.js"></script>
<script type="text/javascript">

    $(function () {
        //注册提交
        $("#regForm").submit(function () {

            var loginName = $("[name=loginName]").val();
            var loginPwd = $("[name=loginPwd]").val();
            var password = $("[name=password]").val();
            var userPhone = $("[name=userPhone]").val();

            if (loginPwd == password) {
                $.post("@Url.Action("ZcRegister", "Home")", {
                    loginName: loginName, loginPwd: loginPwd, userPhone: userPhone
                }, function (data) {
                    if (data == "true") {
                        alert("成功");
                        location.href = "@Url.Action("UserLogin", "Home")";
                    } else {
                        alert("失败");
                    }
                });//end post
            } else {
                layer.alert("密码不一样!", { icon: 5 });
            }
            return false;
        });//end submit

    });

</script>